<template>
	<view class="study_result">
		<view class="close" @click="$emit('close')">
			<image :src="`${baseImageUrl}/common/close1.png`"></image>
		</view>
		<view class="title">
			<view>
				<image :src="`${baseImageUrl}/common/zw.png`"></image>
				<text>学习结果</text>
				<image :src="`${baseImageUrl}/common/zw.png`"></image>
			</view>
		</view>
		<view class="desc">恭喜你获得新技能：</view>
		<scroll-view scroll-x class="scroll_view">
			<view class="item" v-for="item in list" v-if="item.skill">
				<view class="icon">
					<image :src="item.skill.img"></image>
				</view>
				<view class="name">{{item.skill.name}}</view>
			</view>
		</scroll-view>
		<view class="btn" @click="$emit('close')">确定</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: () => []
			}
		}
	}
</script>

<style scoped lang="scss">
	.study_result {
		width: 688rpx;
		height: 606rpx;
		padding: 55rpx 60rpx 70rpx;
		box-sizing: border-box;
		background: url(#{$baseImageUrl}/bg/688_606.png) no-repeat;
		background-size: 100% 100%;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: center;
		position: relative;

		.close {
			width: 122rpx;
			height: 122rpx;
			position: absolute;
			right: 0rpx;
			top: 0rpx;
			transform: translate(50rpx, -50rpx);
			z-index: 2;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.title {
			display: flex;
			justify-content: center;
			align-items: center;

			view {
				height: 30rpx;
				display: flex;
				align-items: center;

				image {
					width: 30rpx;
					height: 30rpx;
				}

				text {
					color: #494338;
					font-size: 42rpx;
					font-weight: 400;
					font-family: LiSu;
					margin: 0 10rpx;
				}
			}
		}

		.desc {
			text-align: center;
			color: #494338;
			font-size: 32rpx;
			font-weight: 400;
			font-family: SimSun;
		}

		.scroll_view {
			white-space: nowrap;

			.item {
				display: inline-block;
				margin-right: 60rpx;

				.icon {
					width: 140rpx;
					height: 140rpx;
					line-height: 140rpx;
					text-align: center;
					background: url(#{$baseImageUrl}/common/add_bg.png) no-repeat;
					background-size: 100% 100%;

					image {
						width: 80rpx;
						height: 80rpx;
						vertical-align: middle;
					}
				}

				.name {
					text-align: center;
					color: #333333;
					font-size: 20rpx;
					font-weight: 400;
					font-family: SimSun;
					margin-top: 10rpx;
				}


				&:last-child {
					margin: 0;
				}
			}
		}

		.btn {
			width: 204rpx;
			height: 74rpx;
			line-height: 74rpx;
			text-align: center;
			color: #FFFFFF;
			font-size: 30rpx;
			font-weight: 400;
			font-family: SimSun;
			background: url(#{$baseImageUrl}/common/btn.png) no-repeat;
			background-size: 100% 100%;
		}
	}
</style>